# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: James Morris <jmorris@securityinnovation.com>

pkgname=python-pgpy
pkgver=0.6.0
pkgrel=2
pkgdesc='Pretty Good Privacy for Python'
arch=('any')
license=('BSD')
url='https://github.com/SecurityInnovation/PGPy'
depends=(
  'python'
  'python-cryptography'
  'python-pyasn1'
)
makedepends=(
  'git'
  'python-setuptools'
)
checkdepends=(
  'python-pytest'
  'python-pytest-order'
)
_commit='a0e56ff79df37652208002dba9f37e29f451c8ac'
source=("$pkgname::git+$url.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python setup.py build
}

check() {
  cd "$pkgname"

  pytest
}

package() {
  cd "$pkgname"

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
